/**
 * key is request URL
 * value is response handler function
 * @type {{}}
 */
export default Object.assign([
    '/login',
    '/sys/account/info',
    '/sys/resource/navigate',
    '/sys/resource/fjglList',
    '/api/project/queryManageProjectList',
    '/api/room/queryFtglPage',
    '/api/project/queryProjectZyType',
    '/api/project/queryProjectLd',
    '/api/project/queryProjectDy',
    '/api/project/queryProjectLc',
    '/api/xmgl/query',
    '/api/xmgl/queryChildren',
    '/api/xmgl/delete',
    '/api/xmgl/queryfeaturesList',
    '/api/xmgl/querysurrounding',
    '/api/xmgl/saveDictInfo',
    '/api/xmgl/cheackDictInfo',
    '/api/xmgl/queryProvinces',
    '/api/xmgl/queryCity',
    '/api/xmgl/queryArea',
    '/api/fjgl/queryFjglPage',
    '/api/fjgl/queryInfo',
    '/api/fjgl/queryRecord',
    '/api/fjgl/queryContract',
    '/api/fjgl/queryResourcesType',
    '/api/fjgl/queryResources',
    '/api/fjgl/queryLdList',
    '/api/fjgl/saveLdData',
    '/api/fjgl/deleteLdData',
    '/api/room/queryFtglPage',
    '/api/htlb/queryByPage',
    '/api/htlb/queryqyType',
    '/api/htlb/querybgType',
    '/api/htbg/queryByPage',
    '/api/htlb/getInfo',
    '/api/rzbl/queryByPage',
    '/api/room/queryLevelAndRoom',
    '/api/room/getRoomHtInfo',
    '/api/room/handleYl',
    '/api/room/handleTz',
    '/api/room/handleUnLock',
    '/api/room/handleLock',
    '/api/xmgl/delete',
    '/api/xmgl/queryByPage',
    '/api/xmgl/addCompany'
].reduce((result, url) => Object.assign(result, { [url]: () => generateResponseResult(url) }), {}), {});

const exDataMap = {

};

function generateResponseResult(path, { success = true, code = 200, message } = {}) {
    let data = undefined;

    try {
        data = require(`../response${path}`).default;
    } catch (e) {
        console.log(`未找到mock返回文件，默认返回空对象 ===> ${path}`);
    }

    return {
        success,
        code,
        message,
        data,
        exData: exDataMap[path]
    }
}
